import java.util.Comparator;


public class ListCompare implements Comparator<Move>{

	public int [][] rankArray;
	public PlayerNBoxes pnb;
	public Board b;
	
	public ListCompare(int[][] t, PlayerNBoxes pnbox, Board board){
		this.rankArray = t;
		this.pnb = pnbox;
		this.b = board;
	}
	
	public int compare(Move arg0, Move arg1) {
		try {
			PlayerNBoxes pnbArg0 = this.pnb.move(arg0);
			PlayerNBoxes pnbArg1 = this.pnb.move(arg1);
			
			pnbArg0.setRank(rankArray);
			int rank0 =pnbArg0.getRank();
			pnbArg1.setRank(rankArray);
			int rank1 = pnbArg1.getRank();
			
			return rank1-rank0;
			
			
			
		} catch (CloneNotSupportedException e) {
		
			e.printStackTrace();
			return 0;
		}
		
	}
	

}
